package com.tebiecloud.goods.client.service;

import com.tebiecloud.common.model.ResultBody;
import com.tebiecloud.goods.client.model.entity.GoodsSpecification;
import com.tebiecloud.goods.client.model.vo.GoodsSpecificationVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 商品规格接口
 * @Author: tebie
 * @Date: 2019-09-16 19:08
 */
public interface IGoodsSpecificationServiceClient {

    /**
     * 获取规格信息列表
     * @param listGoodsSpecificationId 规格id
     * @return
     */
    @PostMapping("/feign/specification/listGoodsSpecificationVO")
    ResultBody<List<GoodsSpecificationVO>> listGoodsSpecificationVO(@RequestParam("listGoodsSpecificationId") List<Long> listGoodsSpecificationId);


    /**
     * 获取规格列表
     * @param specId 规格id
     * @return
     */
    @PostMapping("/feign/specification/infoGoodsSpecification")
    ResultBody<GoodsSpecification> infoGoodsSpecification(@RequestParam("specId") long specId);

    /**
     * 扣减商品规格库存
     * @param goodsSpecificationId 规格id
     * @param amount 扣减库存
     * @return
     */
    @PostMapping("/feign/specification/updateStockQty")
    ResultBody updateStockQty(@RequestParam("goodsSpecificationId") long goodsSpecificationId,
                              @RequestParam("amount") int amount);

    /**
     * 更新销售量
     * @param goodsSpecificationId 规格id
     * @param salesVolume 新增销量
     * @return
     */
    @PostMapping("/feign/specification/updateSalesVolume")
    ResultBody updateSalesVolume(@RequestParam("goodsSpecificationId") long goodsSpecificationId,
                              @RequestParam("salesVolume") int salesVolume);

}
